package models;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import play.db.jpa.Model;

@Entity
@Table(name = "company")
public class Company extends Model {


	@Column(name = "name")
	public String name;
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "company")
	public Set<Types> typeses = new HashSet<Types>(0);
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "company")
	public Set<Product> products = new HashSet<Product>(0);


	public Company() {
	}

	public Company(String name, Set<Types> typeses, Set<Product> products) {
		this.name = name;
		this.typeses = typeses;
		this.products = products;
	}


	

}